/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.softmarket.persistence;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 *
 * @author Marcelo
 */
public class DbMan {
    
    private EntityManager em;
    private EntityManagerFactory emf;
     
    public DbMan(){
        emf = Persistence.createEntityManagerFactory("SoftMarketDesktopPU");
        em = emf.createEntityManager();
    }
    
    public void inserir(Object obj){
        em.getTransaction().begin();
        em.persist(obj);
        em.getTransaction().commit();
    }
    
    
    
    
    
}
